﻿<phone:PhoneApplicationPage 
	x:Class="VkontakteMangoClient.PhotoAblumPage"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:VkontakteViewModel="clr-namespace:VkontakteViewModel;assembly=VkontakteViewModel"
	xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
	FontSize="{StaticResource PhoneFontSizeNormal}"
	Foreground="{StaticResource PhoneForegroundBrush}"
	SupportedOrientations="Portrait" Orientation="Portrait"
	mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
	shell:SystemTray.IsVisible="True">
	<phone:PhoneApplicationPage.Resources>
		<VkontakteViewModel:PhotoAlbumPageViewModel x:Name="photoPageViewModel" />
	</phone:PhoneApplicationPage.Resources>
	<phone:PhoneApplicationPage.DataContext>
		<Binding Source="{StaticResource photoPageViewModel}" />
	</phone:PhoneApplicationPage.DataContext>
	
	<!--LayoutRoot is the root grid where all page content is placed-->
	<Grid x:Name="LayoutRoot" Background="Transparent">
		<!--TitlePanel contains the name of the application and page title-->
		<!--ContentPanel - place additional content here-->
		<Grid x:Name="ContentPanel" Margin="12,0,12,0">
			<StackPanel>
				<StackPanel Orientation="Horizontal">
					<Image HorizontalAlignment="Left" Height="120" Margin="12" VerticalAlignment="Top" Width="120" Source="{Binding UserViewModel.PhotoMedium, Mode=OneWay}"/>
					<StackPanel>
						<TextBlock Text="{Binding UserViewModel.FullNameAndNickName, Mode=OneWay}" Margin="12"  VerticalAlignment="Top" Style="{StaticResource PhoneTextLargeStyle}" HorizontalAlignment="Left"/>
					</StackPanel>
				</StackPanel>
				<ListBox ItemsSource="{Binding PhotoAlbums}" Height="553" SelectedItem="{Binding SelectedPhotoAlbum, Mode=TwoWay}" SelectionMode="Extended">
					<ListBox.ItemTemplate>
						<DataTemplate>
							<Grid Height="140" Width="140">
								<Image Source="{Binding ThumbSource, Mode=OneWay}" Height="140" Width="140" Margin="6" />
								<!--<Image Source="{Binding ImageThumb.Image, Mode=OneWay}" Height="140" Width="140" Margin="6" />-->
								<TextBlock Text="{Binding Title, Mode=OneWay}" HorizontalAlignment="Center" VerticalAlignment="Bottom" TextWrapping="Wrap" />
								
							</Grid>
						</DataTemplate>
					</ListBox.ItemTemplate>
					<ListBox.ItemsPanel>
						<ItemsPanelTemplate>
							<toolkit:WrapPanel Orientation="Horizontal" />
						</ItemsPanelTemplate>
					</ListBox.ItemsPanel>
				</ListBox>





			</StackPanel>
		</Grid>
	</Grid>
 
	<!--Sample code showing usage of ApplicationBar-->
	<phone:PhoneApplicationPage.ApplicationBar>
		<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
			<shell:ApplicationBarIconButton IconUri="/Images/home.png" Text="Home" Click="ApplicationBarIconButtonHome_OnClick"/>
			<shell:ApplicationBarIconButton IconUri="/Images/dark/appbar.favs.addto.rest.png" Text="Pin to start" Click="ApplicationBarMenuItemPinToStart_Click"/>
			<shell:ApplicationBar.MenuItems>
				<shell:ApplicationBarMenuItem Text="Pin to start" Click="ApplicationBarMenuItemPinToStart_Click"/>
			</shell:ApplicationBar.MenuItems>
		</shell:ApplicationBar>
	</phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
